package com.jwsoft.manager.core.gateway.controller;

import com.bifang.assistant.common.constants.Validators;
import com.bifang.assistant.common.vo.BaseVO;
import com.bifang.engine.assistant.core.domain.AppResponse;
import com.bifang.engine.protect.core.annotation.Idempotent;
import com.github.pagehelper.PageInfo;
import com.jwsoft.manager.common.vo.eduStudentEnrollBefore.*;
import com.jwsoft.manager.common.vo.eduStudentEnrollPre.EduStudentEnrollPreKeyVO;
import com.jwsoft.manager.common.vo.eduStudentEnrollPre.EduStudentEnrollPreQueryVO;
import com.jwsoft.manager.common.vo.eduStudentEnrollPre.EduStudentEnrollPreVO;
import com.jwsoft.manager.common.vo.individuation.HouseHoldSaveVO;
import com.jwsoft.manager.core.integration.BatchCallSjgxIntegration;
import com.jwsoft.manager.core.integration.EduStudentEnrollBeforeIntegration;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 义务教育阶段预报名表网关
 *
 * @author wangtao
 * @since 2022-12-13
 */
@RestController
@RequestMapping(value = "/doc/api")
@Tag(name = "义务教育阶段预报名表", description = "义务教育阶段预报名表")
public class EduStudentEnrollBeforeController {

    @Autowired
    public EduStudentEnrollBeforeIntegration eduStudentEnrollBeforeIntegration;
    @Autowired
    public BatchCallSjgxIntegration batchCallSjgxIntegration;

    @Operation(summary = "义务教育阶段预报名表分页查询",description = "义务教育阶段预报名表分页查询")
    @PostMapping(value = "/eduStudentEnrollBefore0001", produces = "application/json;charset=UTF-8")
    public AppResponse<PageInfo<EduStudentEnrollBeforeVO>> getList(@RequestBody @Validated EduStudentEnrollBeforeQueryVO vo) {
        return AppResponse.successData(eduStudentEnrollBeforeIntegration.getList(vo));
    }

    @Operation(summary = "义务教育阶段预报名表根据主键查询详情",description = "义务教育阶段预报名表根据主键查询详情")
    @PostMapping(value = "/eduStudentEnrollBefore0002", produces = "application/json;charset=UTF-8")
    public AppResponse<EduStudentEnrollBeforeVO> getById(@RequestBody @Validated EduStudentEnrollBeforeKeyVO vo) {
        return AppResponse.successData(eduStudentEnrollBeforeIntegration.getById(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "义务教育阶段预报名表新增",description = "义务教育阶段预报名表新增")
    @PostMapping(value = "/eduStudentEnrollBefore0004", produces = "application/json;charset=UTF-8")
    public AppResponse<EduStudentEnrollBeforeVO> add(@RequestBody @Validated(value = {Validators.Add.class}) EduStudentEnrollBeforeVO vo) {
        return AppResponse.successData(eduStudentEnrollBeforeIntegration.add(vo));
    }
    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "义务教育阶段预报名表新增管理员",description = "义务教育阶段预报名表新增管理员")
    @PostMapping(value = "/eduStudentEnrollBeforeJh0004", produces = "application/json;charset=UTF-8")
    public AppResponse<EduStudentEnrollBeforeVO> addJh(@RequestBody @Validated(value = {Validators.Add.class}) EduStudentEnrollBeforeVO vo) {
        return AppResponse.successData(eduStudentEnrollBeforeIntegration.addJh(vo));
    }
    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "义务教育阶段预报名表修改",description = "义务教育阶段预报名表修改")
    @PostMapping(value = "/eduStudentEnrollBefore0005", produces = "application/json;charset=UTF-8")
    public AppResponse<StudentEnrollBeforeSaveVO> edit(@RequestBody @Validated(value = {Validators.Edit.class}) StudentEnrollBeforeSaveVO vo) {
        return AppResponse.successData(eduStudentEnrollBeforeIntegration.edit(vo));
    }
    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "义务教育阶段预报名表修改管理员",description = "义务教育阶段预报名表修改管理员")
    @PostMapping(value = "/eduStudentEnrollBeforeJh0005", produces = "application/json;charset=UTF-8")
    public AppResponse<StudentEnrollBeforeSaveVO> editJh(@RequestBody @Validated(value = {Validators.Edit.class}) StudentEnrollBeforeSaveVO vo) {
        return AppResponse.successData(eduStudentEnrollBeforeIntegration.editJh(vo));
    }
    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "义务教育阶段预报名表删除",description = "义务教育阶段预报名表删除")
    @PostMapping(value = "/eduStudentEnrollBefore0006", produces = "application/json;charset=UTF-8")
    public AppResponse del(@RequestBody @Validated EduStudentEnrollBeforeKeyVO vo) {
        eduStudentEnrollBeforeIntegration.del(vo);
        return AppResponse.successMsg("删除成功！");
    }

    @Operation(summary = "查询特殊通道预报名数据",description = "查询特殊通道预报名数据")
    @PostMapping(value = "/eduStudentEnrollBefore0007", produces = "application/json;charset=UTF-8")
    public AppResponse<PageInfo<EduStudentEnrollPreVO>> querySpecialList(@RequestBody @Validated EduStudentEnrollPreQueryVO vo) {
        return AppResponse.successData(eduStudentEnrollBeforeIntegration.querySpecialList(vo));
    }
    @Operation(summary = "管理员查询特殊通道预报名数据",description = "管理员查询特殊通道预报名数据")
    @PostMapping(value = "/eduStudentEnrollBeforeJh0007", produces = "application/json;charset=UTF-8")
    public AppResponse<PageInfo<EduStudentEnrollPreVO>> querySpecialListManager(@RequestBody @Validated EduStudentEnrollPreQueryVO vo) {
        return AppResponse.successData(eduStudentEnrollBeforeIntegration.querySpecialListManager(vo));
    }

    @Operation(summary = "特殊通道预报名数据单个查询",description = "特殊通道预报名数据单个查询")
    @PostMapping(value = "/eduStudentEnrollBefore0009", produces = "application/json;charset=UTF-8")
    public AppResponse<StudentEnrollBeforeSaveVO> getSpecialDetail(@RequestBody @Validated EduStudentEnrollBeforeQueryVO vo) {
        return AppResponse.successData(eduStudentEnrollBeforeIntegration.getSpecialDetail(vo));
    }

    @Operation(summary = "预报名管理查询预采集数据列表", description = "预报名管理查询预采集数据列表")
    @PostMapping(value = "/eduStudentEnrollBefore0010", produces = "application/json;charset=UTF-8")
    public AppResponse<PageInfo<EduStudentEnrollPreVO>> preList(@RequestBody EduStudentEnrollPreQueryVO vo) {
        return AppResponse.successData(eduStudentEnrollBeforeIntegration.queryPreList(vo));
    }
    @Operation(summary = "预报名管理查询预采集详情", description = "预报名管理查询预采集详情")
    @PostMapping(value = "/eduStudentEnrollBefore0008", produces = "application/json;charset=UTF-8")
    public AppResponse<EduStudentEnrollPreVO> preList(@RequestBody EduStudentEnrollPreKeyVO vo) {
        return AppResponse.successData(eduStudentEnrollBeforeIntegration.getPreDetail(vo));
    }
    @Operation(summary = "预报名管理重新获取网签数据", description = "预报名管理重新获取网签数据")
    @PostMapping(value = "/eduStudentEnrollBefore0011", produces = "application/json;charset=UTF-8")
    public AppResponse getWqByPreId(@RequestBody EduStudentEnrollPreKeyVO vo) {
        eduStudentEnrollBeforeIntegration.getWqByPreId(vo);
        return AppResponse.success();
    }

    @PostMapping(value = "/eduStudentEnrollBefore0012", produces = "application/json;charset=UTF-8")
    @Operation(summary = "预报名管理重新获取参保数据",description = "预报名管理重新获取参保数据")
    public AppResponse getCbByPreId(@RequestBody EduStudentEnrollPreKeyVO vo) {
        eduStudentEnrollBeforeIntegration.getCbByPreId(vo);
        return AppResponse.success();
    }

    @PostMapping(value = "/eduStudentEnrollBefore0013", produces = "application/json;charset=UTF-8")
    @Operation(summary = "预报名管理重新获取开办企业数据",description = "预报名管理重新获取开办企业数据")
    public AppResponse getQyByPreId(@RequestBody EduStudentEnrollPreKeyVO vo) {
        eduStudentEnrollBeforeIntegration.getQyByPreId(vo);
        return AppResponse.success();
    }

    @PostMapping(value = "/eduStudentEnrollBefore0014", produces = "application/json;charset=UTF-8")
    @Operation(summary = "预报名管理重新获取居住证数据",description = "预报名管理重新获取居住证数据")
    public AppResponse getJzzByPreId(@RequestBody EduStudentEnrollPreKeyVO vo) {
        eduStudentEnrollBeforeIntegration.getJzzByPreId(vo);
        return AppResponse.success();
    }
    @PostMapping(value = "/eduStudentEnrollBefore0015", produces = "application/json;charset=UTF-8")
    @Operation(summary = "预报名管理重置比对错误数据",description = "预报名管理重置比对错误数据")
    public AppResponse resetError(@RequestBody BaseVO vo) {
        eduStudentEnrollBeforeIntegration.resetError(vo);
        return AppResponse.success();
    }
    @PostMapping(value = "/eduStudentEnrollBefore0016", produces = "application/json;charset=UTF-8")
    @Operation(summary = "预报名管理查询预报名列表",description = "预报名管理查询预报名列表")
    public AppResponse<PageInfo<EduStudentEnrollBeforeVO>> queryBeforeList(@RequestBody EduStudentEnrollBeforeQueryVO vo) {
        return AppResponse.successData(eduStudentEnrollBeforeIntegration.queryBeforeList(vo));
    }
    @PostMapping(value = "/eduStudentEnrollBefore0017", produces = "application/json;charset=UTF-8")
    @Operation(summary = "预报名管理根据预采集获取房产",description = "预报名管理根据预采集获取房产")
    public AppResponse getFcByPreId(@RequestBody EduStudentEnrollPreKeyVO vo) {
        eduStudentEnrollBeforeIntegration.getFcByPreId(vo);
        return AppResponse.success();
    }
    @PostMapping(value = "/eduStudentEnrollBefore0027", produces = "application/json;charset=UTF-8")
    @Operation(summary = "根据预采集获取房产不校验",description = "根据预采集获取房产不校验")
    public AppResponse getFcByPreIdNoClick(@RequestBody EduStudentEnrollPreKeyVO vo) {
        eduStudentEnrollBeforeIntegration.getFcByPreIdNoClick(vo);
        return AppResponse.success();
    }
    @PostMapping(value = "/eduStudentEnrollBefore0018", produces = "application/json;charset=UTF-8")
    @Operation(summary = "预报名管理根据预采集获取户籍",description = "预报名管理根据预采集获取户籍")
    public AppResponse getHjByPreId(@RequestBody HouseHoldSaveVO vo) {
        eduStudentEnrollBeforeIntegration.getHjByPreId(vo);
        return AppResponse.success();
    }
    @PostMapping(value = "/eduStudentEnrollBefore0019", produces = "application/json;charset=UTF-8")
    @Operation(summary = "预报名管理家庭成员信息比对",description = "预报名管理家庭成员信息比对")
    public AppResponse getFamInfoComparison(@RequestBody EduStudentEnrollPreKeyVO vo) {
        return AppResponse.successData(eduStudentEnrollBeforeIntegration.getFamInfoComparison(vo));
    }
    @PostMapping(value = "/eduStudentEnrollBefore0020", produces = "application/json;charset=UTF-8")
    @Operation(summary = "预报名管理单个可报名数据生成",description = "预报名管理单个可报名数据生成")
    public AppResponse createEnrollBefore(@RequestBody EduStudentEnrollPreKeyVO vo) {
        eduStudentEnrollBeforeIntegration.createEnrollBefore(vo);
        return AppResponse.success();
    }
    @PostMapping(value = "/eduStudentEnrollBefore0021", produces = "application/json;charset=UTF-8")
    @Operation(summary = "预报名管理批量生成预报名数据",description = "预报名管理批量生成预报名数据")
    public AppResponse createBatch(@RequestBody BatchCreateVO vo) {
        eduStudentEnrollBeforeIntegration.createBatch(vo);
        return AppResponse.success();
    }
    @PostMapping(value = "/eduStudentEnrollBefore0022", produces = "application/json;charset=UTF-8")
    @Operation(summary = "预报名管理批量生成缓存清除",description = "预报名管理批量生成缓存清除")
    public AppResponse clearCacheCreate(@RequestBody BaseVO vo) {
        eduStudentEnrollBeforeIntegration.clearCacheCreate(vo);
        return AppResponse.success();
    }
    @PostMapping(value = "/eduStudentEnrollBefore0023", produces = "application/json;charset=UTF-8")
    @Operation(summary = "预报名管理人员缓存清除",description = "预报名管理人员缓存清除")
    public AppResponse clearCachePre(@RequestBody EduStudentEnrollPreKeyVO vo) {
        eduStudentEnrollBeforeIntegration.clearCachePre(vo);
        return AppResponse.success();
    }
    @PostMapping(value = "/eduStudentEnrollBefore0025", produces = "application/json;charset=UTF-8")
    @Operation(summary = "根据预采集重新比对房产一致",description = "根据预采集重新比对房产一致")
    public AppResponse getFcyz(@RequestBody EduStudentEnrollPreKeyVO vo) {
        batchCallSjgxIntegration.getFcyz(vo);
        return AppResponse.success();
    }

    @Operation(summary = "修改代理报名状态",description = "修改代理报名状态")
    @PostMapping(value = "/eduStudentEnrollBefore0026", produces = "application/json;charset=UTF-8")
    public AppResponse updateAgentEnrollFlag(@RequestBody @Validated EduAgentEnrollVO vo) {
        eduStudentEnrollBeforeIntegration.updateAgentEnrollFlag(vo);
        return AppResponse.success();
    }
}
